package cn.wolfcode.rbac.domain;

import com.alibaba.fastjson.JSON;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.HashMap;
import java.util.Map;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Department extends BaseDomain{
    private String name;
    private String sn;

    //写一个JSON方法get 来获取list.ftl中提交过来的表单数据
    /*public String getJson(){
        return "{\"name\":\"dddd\"}";
    }*/

    //使用fastjson来生成
    public String getJson(){
        Map map = new HashMap();
        map.put("id",id);
        map.put("name",name);
        map.put("sn",sn);
        return JSON.toJSONString(map);
    }
}
